home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Rekt_ayMæk / Source / MyVUMeterPeriodical.h < prev   
Encoding:
Text File  |  2000-06-23  |  901 b   |  48 lines

  1. // MyVUMeterPeriodical.h
  2. // Gregory Lo
  3. // 22 June 2000 (MacHack 2000)
  4.  
  5. #pragma once
  6.  
  7. #include <MacTypes.h>
  8. #include <Sound.h>
  9. #include <Events.h>
  10. #include <DrawSprocket.h>
  11.  
  12. #include <LPeriodical.h>
  13.  
  14. class MyVUMeterPeriodical : public LPeriodical
  15. {
  16.     public:
  17.     
  18.     enum
  19.     {
  20.         kkVUMeterDelay            = 1,
  21.         kVUMeterVelocityUp        = 15,
  22.         kVUMeterVelocityDown    = 10,
  23.         kVUMeterMinIntensity    = 5,
  24.         kVUMeterMaxIntensity    = 100,
  25.         kVUMeterPulse            = 30
  26.     };
  27.  
  28.     void            Pulse( SInt32 inPulse = kVUMeterPulse );
  29.     void            PulseTo( SInt32 inPulseDst = kVUMeterMaxIntensity );
  30.     void            Reset( void );
  31.     void            Toggle( void );
  32.  
  33.     virtual    void    SpendTime( const EventRecord& inMacEvent );
  34.  
  35.     static MyVUMeterPeriodical&    Instance( void );
  36.  
  37.     protected:
  38.     
  39.                     MyVUMeterPeriodical( void );
  40.                     ~MyVUMeterPeriodical( void );
  41.  
  42.     SInt32            mIntensity;
  43.     SInt32            mDstIntensity;
  44.     UInt32            mLastUpdateTime;
  45.     SInt32            mVelocity;
  46.     long            mSIRefNum;
  47. };
  48.